﻿@{
    Layout = null;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Login</title> 
    <link href="~/Content/default/style.css" rel="stylesheet" /> 
     <script src="~/scripts/jquery/jquery-1.8.2.js"></script>
    <script type="text/javascript">
        $(function() {
            //检测IE
            if ('undefined' == typeof(document.body.style.maxHeight))
                window.location.href = 'ie6update.html';
        });
         

            $(document).ready(function () {
            $("#UserAccount").focus();
            $("#btnlogin").click(login);

            function loadPage(urlStr) {
                document.location.href = urlStr;
            }
            function login() { 
                var datas = $("#loginform").serialize();
                var url = '@Url.Action("UserLogin")';
                $.ajax({
                    url: url,
                    type: "post",
                    dataType: 'json',
                    data: datas,
                    success: function (data) {
                        if (data.IsSuccess) {
                            loadPage(data.Data);
                        }
                        else {
                            $("#msgtip").text(data.Msg);
                        }
                    }
                });
                return false;
            }
         
        });
           
        
    </script>
</head>
<body>
    <body class="loginbody">

        <div class="login-screen">
            <div class="login-icon">LOGO</div>
            <div class="login-form">
                <h1>系统管理登录</h1>
                <form id="loginform" method="post">
                    <div class="control-group">
                        <input type="text" id="txtUserName" name ="txtUserName" class="login-field" placeholder="用户名" title="用户名"  value="admin"/>

                        <label class="login-field-icon user" for="txtUserName"></label>
                    </div>
                    <div class="control-group">
                        <input type="password" id="txtPassword" name="txtPassword" class="login-field" placeholder="密码" title="密码"  value="q1q1q1"/>

                        <label class="login-field-icon pwd" for="txtPassword"></label>
                    </div>
                    <div>
                        <input type="submit" value="登 录"  id="btnlogin"  class="btn-login"    />
                    </div>
                    <span class="login-tips"><i></i><b id="msgtip" >请输入用户名和密码 </b>
                        
                    </span>
                </form>
            </div>
            <i class="arrow">箭头</i>
        </div>

    </body>
</body>
</html>
